home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / Bowers Development / AppMaker 2.0b5 / Examples / Windows MFC / MFC generated / Demo1Dlg.cp < prev    next >
Text File  |  1996-01-01  |  3KB  |  144 lines

  1. // Demo1Dlg.cp -- application methods
  2. // Created 01/01/95 12:01 PM by AppMaker
  3.  
  4. #include "stdafx.h"
  5. #include "Demo1Dlg.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "CDemo1DlgDoc.h"
  9. #include "CDemo1DlgView.h"
  10.  
  11. #ifdef _DEBUG
  12. #undef THIS_FILE
  13. static char BASED_CODE THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. //
  17. // class CDemo1DlgApp
  18. //
  19.  
  20. BEGIN_MESSAGE_MAP(CDemo1DlgApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CDemo1DlgApp)
  22.     // Handlers within the section marked by {{AFX_MSG_MAP and }}AFX_MSG_MAP
  23.     // are maintained by ClassExpress.    
  24.     ON_COMMAND(ID_APP_ABOUT, OnAbout)
  25.     //}}AFX_MSG_MAP
  26.  
  27.     // Use inherited File/New, File/Open code.
  28.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  29.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  30.  
  31.     // Use inherited File/Print Setup...
  32.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  33.  
  34.     // Global help commands
  35.     ON_COMMAND(ID_HELP_INDEX, CWinApp::OnHelpIndex)
  36.     ON_COMMAND(ID_HELP_USING, CWinApp::OnHelpUsing)
  37.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  38.     ON_COMMAND(ID_CONTEXT_HELP, CWinApp::OnContextHelp)
  39.     ON_COMMAND(ID_DEFAULT_HELP, CWinApp::OnHelpIndex)
  40. END_MESSAGE_MAP()
  41.  
  42. //
  43. // CDemo1DlgApp constructor
  44. //
  45.  
  46. CDemo1DlgApp::CDemo1DlgApp()
  47. {
  48.     // You can initialize member variables here.    Most of the initialization
  49.     // code, however, should go into CDemo1DlgApp::InitInstance().
  50. }
  51.  
  52.  
  53. // There is only one instance of the CDemo1DlgApp object
  54. CDemo1DlgApp NEAR theApp;
  55.  
  56. //
  57. // CDemo1DlgApp initialization
  58. //
  59.  
  60. BOOL CDemo1DlgApp::InitInstance()
  61. {
  62. #if (_MFC_VER >= 0x0300)
  63.     Enable3dControls();
  64. #else
  65.     EnableVBX();
  66.     SetDialogBkColor();
  67. #endif
  68.  
  69.     LoadStdProfileSettings();                         // Load information from the .INI
  70.  
  71.     // Register our document templates.
  72.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  73.             RUNTIME_CLASS(CDemo1DlgDoc),
  74.             RUNTIME_CLASS(CMainFrame),        
  75.             RUNTIME_CLASS(CDemo1DlgView)));
  76.  
  77.     if (! m_lpCmdLine[0])    {
  78.         OnFileNew();
  79.     }    else {
  80.         OpenDocumentFile(m_lpCmdLine);
  81.     }
  82.  
  83.     return TRUE;
  84. }
  85.  
  86. //
  87. // class CAboutDlg
  88. //
  89.  
  90. class CAboutDlg : public CDialog
  91. {
  92. public:
  93.     CAboutDlg();
  94.  
  95.     //{{AFX_DATA(CAboutDlg)
  96.     enum { IDD = IDD_ABOUTBOX };
  97.     //}}AFX_DATA
  98.  
  99. // Mapped functions
  100. protected:
  101.     DECLARE_MESSAGE_MAP()
  102.  
  103.     virtual void DoDataExchange(CDataExchange *pDX);    
  104.     //{{AFX_MSG(CAboutDlg)
  105.     // Handlers within the section marked by {{AFX_MSG and }}AFX_MSG
  106.     // are maintained by ClassExpress.    
  107.     //}}AFX_MSG
  108. };
  109.  
  110. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  111. {
  112.     //{{AFX_DATA_INIT(CAboutDlg)
  113.     //}}AFX_DATA_INIT
  114. }
  115.  
  116. void CAboutDlg::DoDataExchange(CDataExchange *pDX)
  117. {
  118.     CDialog::DoDataExchange(pDX);
  119.     //{{AFX_DATA_MAP(CAboutDlg)
  120.     //}}AFX_DATA_MAP
  121. }
  122.  
  123. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  124.     //{{AFX_MSG_MAP(CAboutDlg)
  125.     // Handlers within the section marked by {{AFX_MSG_MAP and }}AFX_MSG_MAP
  126.     // are maintained by ClassExpress.    
  127.     //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129.  
  130.  
  131. void CDemo1DlgApp::OnAbout()
  132. {
  133.     CAboutDlg aboutDlg;
  134.     aboutDlg.DoModal();
  135. }
  136.  
  137. // VBX handling
  138. //{{AFX_VBX_REGISTER_MAP()
  139. //}}AFX_VBX_REGISTER_MAP
  140.  
  141. //
  142. // CDemo1DlgApp commands
  143. //
  144.